package com.watson.springtest.aspect;

import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;

/**
 * @program: mytest
 * @description:
 * @author: zhangpeng348@jd.com
 * @date: 2019-07-24 16:29
 **/
@Aspect
public class Audience {

    String retVal = "";

    @Pointcut("execution(**com.watson.springtest.aspect.Performance.perform(..)) && args(ret)")
    private void preformance(String ret) {}

    @Pointcut("execution(**com.watson.springtest.aspect.Performance.perform(..))")
    private void count() {}

    @AfterReturning(value = "execution(**com.watson.springtest.aspect.Performance.music(..))", returning = "returnVal")
   public String afterReturn(Object returnVal) {
        String ret = "";
        return ret;
    }

    @Before(value = "preformance(ret)")
    public String berforReturn(Object ret) {
        return retVal;
    }
}
